import 'package:amap_base/amap_base.dart';
import 'package:car_map/mode/navigation_model.dart';
import 'package:flutter/material.dart';

class WidgetNavigationItem {
  static Widget widgetNavigationItem(NavigationModel navigationModel) {
    return Container(
      decoration: BoxDecoration(
        border: Border(
          bottom: BorderSide(
            color: Colors.black12,
            width: 0.5
          )
        )
      ),
      child: ListTile(
        title: Text('${navigationModel.title}',style: TextStyle(color: Colors.blue),),
        subtitle: Text('${navigationModel.address}'),
        trailing: Icon(
          navigationModel.iconData,
          color: Colors.blue,
        ),
        onTap: () {
          AMapNavi().startNavi(
            lat: navigationModel.latitude,
            lon: navigationModel.longitude,
            naviType: AMapNavi.ride,
          );
        },
      ),
    );
  }
}
